<?php
/**
 * Created by PhpStorm.
 * User: VJLau
 * Date: 2018/2/5
 * Time: 下午4:36
 */

$id = intval($_GPC['id']);

// 目的地
$dest = pdo_fetch("SELECT * FROM " . tablename('bontrip_dest')
    . " WHERE id = '{$id}' AND deleted_at is null");
if (empty($dest)) {
    message('目的地不存在或已删除！', $this->createMobileUrl('list'), 'error');
}

// 图片
$thumbs = array();
if (!empty($dest['thumbs'])) {
    $thumbs = unserialize($dest['thumbs']);
}

// 单品
$singles = pdo_fetchall("SELECT * FROM " . tablename('bontrip_single')
    . " WHERE dest_id = {$id} and deleted_at is null ORDER BY sort ASC,id DESC");
$single_count = count($singles);

// 线路 TODO

$title = $dest['name'];
include $this->template('dest');